

*set filepath. NOTE: you will need to update the filepath to run this file
cd "/Users/jeremyhorowitz/Documents/Book/Replication files/Chapter 7"


**************************************************************
********** Figure 7.1 ****************************************
**************************************************************

use "group_aggregates.dta"

line asante year, lc(black) lp(solid) lw(thick) || ///
line fante year, lc(black)  lp(dash) || ///
line brong year, lc(black)  lp(longdash_dot) || ///
line akan_other year, lc(black) lp(dot) || ///
line gadangbe year, lc(black) lp(dash_dot) ||  ///
line ewe year, lc(black) lp(solid) lw(vthick) ||  ///
line guan year, lc(black) lp(shortdash) ||  ///
line gurma year, lc(black) lp(shortdash_dot) ||  ///
line moledagbani year, lc(black) lp(solid) ||  ///
line grusi year, lc(black) lp(dot) ///
scheme(s1mono)  ylabel(, angle(0)) ///
xlabel(1992 "1992" 1996 "1996" 2000 "2000" 2004 "2004" 2008 "2008" 2012 "2012" 2016 "2016") /// 
xtitle("") ///
plotregion(lcolor(white)) ///
ytitle(Percent) xsize(8) ysize(3.5) legend(pos(3) c(1) order(1 4 3 2 8 10 5 9 7 6) ///
label(1 "Ashanti [15%]") label(2 "Fante [10%]")  label(3 "Brong [5%]") label(4 "Akan-other [20%]") ///
label(5 "Ga Adangbe [8%]") label(6 "Ewe [13%]") label(7 "Guan [4%]") label(8 "Gurma [4%]") label(9 "Mole-Dagbani [17%]") ///
label(10 "Grusi [3%]"))  /// 
scale(1.2) ///
xline(2001 2009 2013) ///
text(105 1996 "Rawlings") text(99 1996 "(NDC)") ///
text(105 2005 "Kufuor") text(99 2005 "(NPP)") ///
text(105 2011 "Atta Mills") text(99 2011 "(NDC)") ///
text(105 2015 "Mahama") text(99 2015 "(NDC)")


**************************************************************
********** Table 7.2 *****************************************
**************************************************************

*Data not publicly available -- contact author for access information.



**************************************************************
********** Figure 7.2 ****************************************
**************************************************************

use "approval ratings summary.dta", clear // note: file contains aggregates based on data available from Afrobarometer.org

line health year, lc(black) lp(solid) || ///
line education year, lc(black)  lp(dash) || ///
line jobs year, lc(black)  lp(dot) || ///
line income year, lc(black)  lp(dash_dot) || ///
line corr year, lc(black) lp(shortdash)  ///
scheme(s1mono)  ylabel(0(10)100, angle(0)) xlabel(1999 "1999" 2002 "2002" 2005 "2005" 2008 "2008" ) xtitle("") ///
legend(off) plotregion(lcolor(white)) ///
text(86 2008.2 "Health", place(e))  text(80 2008.2 "Education", place(e)) text(58 2008.2 "Corruption", place(e)) text(52.5 2008.2 "Jobs", place(e)) ///
text(35 2008.2 "Income gaps", place(e)) graphregion(margin(r 30)) scale(1.2) ytitle(Percent)








